home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam20 / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-27  |  1.3 KB  |  91 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24.  
  25. #include "generics.h"
  26.  
  27.  
  28. static    int    myThread(char *arg);
  29.  
  30.  
  31. main(int argc, char *argv[])
  32. {
  33.     object    t2;
  34.  
  35.     InitDynace(&argc);
  36.  
  37.     /*  Start the threader.  This also makes the the currently running
  38.         main() function the first thread.  */
  39.  
  40.     StartThreader(argc);
  41.  
  42.  
  43.     t2 = gNewThread(Thread, "t2", myThread, DEFAULT_PRIORITY, "t2", 1, 0);
  44.  
  45.     myThread("main");
  46.  
  47.     gWaitFor(t2);
  48.  
  49.     return 0;
  50. }
  51.  
  52.  
  53. static    int    myThread(char *arg)
  54. {
  55.     long     i;
  56.     object     obj;
  57.  
  58.     obj = gNewWithLong(LongInteger, 0L);
  59.     for (i=0L ; i++ != 1000L ; )  {
  60.         gChangeLongValue(obj, i);
  61.         gPrintValue(obj, stdoutStream);
  62.         printf(" - %s\n", arg);
  63.     }
  64.     gDispose(obj);
  65.     return 0;
  66. }
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. /*
  74.  *
  75.  *    This source code is CONFIDENTIAL and
  76.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  77.  *    distribution, adaptation or use    may
  78.  *    be subject to civil and    criminal penalties.
  79.  *
  80.  *    Copyright (c) 1993 Algorithms Corporation
  81.  *    3020 Liberty Hills Drive
  82.  *    Franklin, TN  37064
  83.  *
  84.  *    ALL RIGHTS RESERVED.
  85.  *
  86.  *
  87.  *
  88.  */
  89.  
  90.  
  91.